<div class="example-container"
    [class.mat-elevation-z2]="!isActive"
    [class.mat-elevation-z8]="isActive">
  Example
</div>

<button mat-button (click)="isActive = !isActive">Toggle Elevation</button>
